//
//  UINavigationController+LZBase.m
//  Smart
//
//  Created by ZYF MacMini on 2022/11/15.
//

#import "UINavigationController+HHExtension.h"

@implementation UINavigationController (HHExtension)

/*
 *  替换 控制器
 */
- (void)lz_replaceViewController:(UIViewController *)viewController animated:(BOOL)animated {
    NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:self.viewControllers];
    if (viewControllers.count < 1) {
        return;
    }
    [viewControllers replaceObjectAtIndex:viewControllers.count-1 withObject:viewController];
    [self setViewControllers:viewControllers animated:animated];
}

@end
